<template>

	<view class="main">
		<u-navbar :fixed="false" title="病历详情" @rightClick="rightClick" :autoBack="true"></u-navbar>

		<view class=" column_c">

			<view class="card-content" style="margin-top: 30rpx;">

				<view class="hzxx">基础信息</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>

				<view class="row_a_c space-between item-a">
					<text class="clinic">医生</text>
					<text class="status  center">{{InfosData.doctor.name}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">助理</text>
					<text class="status  center">{{InfosData.assistant.name}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">科室</text>
					<text class="status  center">{{InfosData.territory.name}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">就诊时间</text>
					<text class="status  center">{{InfosData.created_at}}</text>
				</view>

				<view class="row_a_c space-between item-a">
					<text class="clinic">病历类型</text>
					<text class="status  center" style="color: #27CCBB;" v-if="InfosData.type==1">初诊病历</text>
					<text class="status  center" style="color: #27CCBB;" v-else>复诊病历</text>
				</view>

			</view>

			<view class="card-content">
				<view class="hzxx">患者信息</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>
				<view class="item-a">
					<text class="clinic">主诉</text>
					<view class="shumin">
						{{InfosData.chief_complaint}}
					</view>
				</view>
				<view class="item-a">
					<text class="clinic">现病史</text>
					<view class="shumin">
						{{InfosData.current_medical_history}}
					</view>
				</view>
				<view class="item-a">
					<text class="clinic">既往史</text>
					<view class="shumin">
						{{InfosData.past_medical_history}}
					</view>
				</view>
			</view>


			<view class="card-content">
				<view class="hzxx">诊断及治疗</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>
				<view class="item-a">
					<text class="clinic">诊断</text>
					<view class="shumin">
						{{InfosData.diagnosis}}
					</view>
				</view>
				<view class="item-a">
					<text class="clinic">治疗计划</text>
					<view class="shumin">
						{{InfosData.treatment}}
					</view>
				</view>
			</view>


			<view class="card-content">
				<view class="hzxx">医嘱</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>
				<view class="item-a">
					<text class="clinic">医嘱</text>
					<view class="shumin">
						{{InfosData.enjoin}}
					</view>
				</view>
				<view class="item-a">
					<text class="clinic">备注</text>
					<view class="shumin">
						{{InfosData.remark}}
					</view>
				</view>

			</view>

		</view>




	</view>

</template>

<script>
	import api_mr from '@/api/mr.js';

	export default {

		async onLoad(option) {
			this.medical_record = option.id;
		},

		async onShow() {
			this.access_token = uni.getStorageSync('access_token');
			if (!this.access_token) {
				uni.navigateTo({
					url: '/pages/auth/login'
				});
			} else {
				this.medicalRecordDetailFuc(); //查看病历详情---已完结的
			}
		},


		data() {
			return {
				medical_record: null,
				access_token: null,
				bgColor: 'rgba(0, 31, 63, 0)',
				InfosData: null,

			};
		},
		methods: {
			//查看病历详情---已完结的
			async medicalRecordDetailFuc() {
				var per = {
					medical_record: this.medical_record
				}
				const res = await api_mr.medicalRecordDetail(per);
				if (res.code == 1) {
					this.InfosData = res.data.info
				} else {
					this.$util.msg(res.message);
					return;
				}
			},

		}
	};
</script>

<style scoped lang="scss">
	.main {
		background: #FAFAFA;
		height: 100%;
	}

	.time {
		font-weight: 400;
		font-size: 28rpx;
		color: #7F7F7F;
	}

	.card {
		background-color: #fff;
		border-radius: 8px;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
		margin-bottom: 20px;
	}

	.item-a {
		margin-bottom: 32rpx;
	}

	.status {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.85);
	}

	.clinic {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.6);
	}

	.card-content {
		width: 686rpx;
		min-height: 200rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 8rpx -2rpx rgba(0, 0, 0, 0.04), 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.03), 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.02);
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		padding: 32rpx 32rpx 0 32rpx;
		margin-bottom: 20rpx;
	}

	.time {
		font-weight: 400;
		font-size: 24rpx;
		color: rgba(0, 0, 0, 0.6);
		margin-bottom: 12rpx;
	}


	.hzxx {
		font-weight: 600;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.85);
	}

	.shumin {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.85);
		margin-top: 8rpx;
	}
</style>